require(['../config/requireconfig'],function(config){
	//根据需要添加
	require(['jquery','common/pccommons'],function($,com){
        com.init({headerPos:{cur:"game"}, lazyHeader:true});
        com.header();
		var pageLogic = new PageLogic($,com);
		pageLogic.init();

	});
});

var PageLogic = function($,com){
	
	return {
		init:function(){
			var _this = this;
			//_this.banner();
			_this.bindEvents();
		},
		banner:function(){
			com.ajax({
				url:'/pc/home/banners.ahtml',
				type:'get',
				data:{"systemDiv":18 , "type" :2 ,  "bannerArea":2}, 
				success:function(data){
					var array=new Array(); 
					$(data.data).each(function(idx,ban){
						var map = {} 		 			 
						map.imgPath = ban.imageUrl;  
						map.url = ban.url;
						array.push(map);
				 	});
					banner.init({
						container:$(".banner"),
						data:array
					});
				}
			});
			/*var data = {
							"indexBanner":{
								"code":"SUCCESS",
								"message":"处理成功(SUCCESS)",
								"data":[
										{"imgPath":"../../frontlib/img/banner/1.jpg","url":"https://www.baidu.com"},
										{"imgPath":"../../frontlib/img/banner/2.jpg","url":"https://www.sina.com"},
										{"imgPath":"../../frontlib/img/banner/3.jpg","url":"https://www.baidu.com"}
								]
							}
						};
			banner.init({
				container:$(".banner"),
				data:data.indexBanner.data
			});*/
		},
		bindEvents:function(){
			var _this = this;
			//tab切换
			$(".single-button").on("click",function(){
				$(".single-button").removeClass("active");
				$(this).addClass("active");
			});
			// 	招募中的游戏单个项切换
			$(".game-select-cell").on("click",function(){
				$(this).siblings().find(".arrow").addClass("top").removeClass("bottom");
				if($(this).find(".arrow").hasClass("top")){
					$(this).find(".arrow").removeClass("top").addClass("bottom");
				}else{
					$(this).find(".arrow").removeClass("bottom").addClass("top");
				}
				
			});
		},
	}
}
